/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Nas
 */
@Entity
@Table(name = "EVALUACION_MC")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "EvaluacionMc.findAll", query = "SELECT e FROM EvaluacionMc e"),
    @NamedQuery(name = "EvaluacionMc.findByIdEvaluacionMc", query = "SELECT e FROM EvaluacionMc e WHERE e.idEvaluacionMc = :idEvaluacionMc"),
    @NamedQuery(name = "EvaluacionMc.findByValor", query = "SELECT e FROM EvaluacionMc e WHERE e.valor = :valor")})
public class EvaluacionMc implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_EVALUACION_MC")
    private Integer idEvaluacionMc;
    @Column(name = "VALOR")
    private BigDecimal valor;
    @JoinColumn(name = "ID_MEDIDA_CORPORAL", referencedColumnName = "ID_MEDIDA_CORPORAL")
    @ManyToOne
    private MedidaCorporal idMedidaCorporal;
    @JoinColumn(name = "ID_EVALU_MEDICA", referencedColumnName = "ID_EVALU_MEDICA")
    @ManyToOne(optional = false)
    private HistoriaClinica idEvaluMedica;

    public EvaluacionMc() {
    }

    public EvaluacionMc(Integer idEvaluacionMc) {
        this.idEvaluacionMc = idEvaluacionMc;
    }

    public Integer getIdEvaluacionMc() {
        return idEvaluacionMc;
    }

    public void setIdEvaluacionMc(Integer idEvaluacionMc) {
        this.idEvaluacionMc = idEvaluacionMc;
    }

    public BigDecimal getValor() {
        return valor;
    }

    public void setValor(BigDecimal valor) {
        this.valor = valor;
    }

    public MedidaCorporal getIdMedidaCorporal() {
        return idMedidaCorporal;
    }

    public void setIdMedidaCorporal(MedidaCorporal idMedidaCorporal) {
        this.idMedidaCorporal = idMedidaCorporal;
    }

    public HistoriaClinica getIdEvaluMedica() {
        return idEvaluMedica;
    }

    public void setIdEvaluMedica(HistoriaClinica idEvaluMedica) {
        this.idEvaluMedica = idEvaluMedica;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEvaluacionMc != null ? idEvaluacionMc.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EvaluacionMc)) {
            return false;
        }
        EvaluacionMc other = (EvaluacionMc) object;
        if ((this.idEvaluacionMc == null && other.idEvaluacionMc != null) || (this.idEvaluacionMc != null && !this.idEvaluacionMc.equals(other.idEvaluacionMc))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.EvaluacionMc[ idEvaluacionMc=" + idEvaluacionMc + " ]";
    }
    
}
